package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

class zblz {
   static com.aspose.cells.b.a.b.zq a(Shape var0) throws Exception {
      if (var0.getMsoDrawingType() == 5) {
         Chart var2 = ((ChartShape)var0).a();
         return new com.aspose.cells.b.a.b.zq((float)var2.getChartObject().getLeft(), (float)var2.getChartObject().getTop(), (float)var2.getChartObject().getWidth(), (float)var2.getChartObject().getHeight());
      } else {
         zbkq var1 = new zbkq(c(var0.getMsoDrawingType()));
         a(var0, var1);
         var1.G();
         return var1.S();
      }
   }

   static void a(com.aspose.cells.b.a.d.zm var0, ImageOrPrintOptions var1, Shape var2) throws Exception {
      if (var2.getMsoDrawingType() == 5) {
         Chart var6 = ((ChartShape)var2).a();
         var6.a(var0, var1);
      } else {
         zbkq var3 = new zbkq(c(var2.getMsoDrawingType()));
         a(var2, var3);
         if (!var3.d) {
            var3.c(0.0F);
            var3.d(0.0F);
         }

         if (var3.R()) {
            ImageFormat var4 = var1.getImageFormat();
            zn var5 = a(var2, var3, var0, var4, var1);
            if (var5 != null) {
               var5.l();
            }

         }
      }
   }

   private static zn a(Shape var0, zbkq var1, com.aspose.cells.b.a.d.zm var2, ImageFormat var3, ImageOrPrintOptions var4) {
      int var5 = zadb.b;
      com.aspose.cells.b.a.b.zt var6 = var1.F().e();
      zn var7 = zadb.a(var5, (int)Math.ceil((double)var6.b()), (int)Math.ceil((double)var6.c()), var3, var4, var2, var1);
      return var7;
   }

   private static float[] b(Shape var0) {
      float var1 = 0.0F;
      float var2 = 0.0F;

      Shape var4;
      for(Shape var3 = var0; var3.S(); var3 = var4) {
         var4 = (Shape)var3.F();
         var1 += (float)(var3.getLeftInShape() * var4.getWidth()) / 4000.0F;
         var2 += (float)(var3.getTopInShape() * var4.getHeight()) / 4000.0F;
      }

      return new float[]{var1, var2};
   }

   private static void b(Shape var0, zbkq var1) {
      boolean var2 = false;
      if (var0.S()) {
         var2 = true;
      } else if (var0.getType() == 20 || var0.getType() == 32 || var0.getType() == 13 || var0.getType() == 87 || var0.getType() == 136) {
         var2 = true;
      }

      if (var2) {
         double var3 = var0.getRotationAngle();
         var3 %= 360.0D;
         if (var3 < 0.0D) {
            var3 += 360.0D;
         }

         int var5 = Math.abs(var0.getWidth() - var0.getHeight());
         if (var0.getWidth() > var0.getHeight()) {
            if (var3 >= 45.0D && var3 < 135.0D || var3 >= 225.0D && var3 < 315.0D) {
               var1.c(var1.h() + (float)(var5 / 2));
               var1.d(var1.i() - (float)(var5 / 2));
            }
         } else if (var3 >= 45.0D && var3 < 135.0D || var3 >= 225.0D && var3 < 315.0D) {
            var1.c(var1.h() - (float)(var5 / 2));
            var1.d(var1.i() + (float)(var5 / 2));
         }
      }

   }

   static void a(Shape var0, zbkq var1) throws Exception {
      MsoTextFrame var2 = var0.getTextFrame();
      zany var3 = new zany();
      var1.h = var0;
      if (!var0.getTextFrame().isAutoMargin()) {
         var3.a((double)((int)(var2.getLeftMarginPt() * (double)var0.L().L() / 72.0D)));
         var3.b((double)((int)(var2.getTopMarginPt() * (double)var0.L().M() / 72.0D)));
         var3.c((double)((int)(var2.getRightMarginPt() * (double)var0.L().M() / 72.0D)));
         var3.d((double)((int)(var2.getBottomMarginPt() * (double)var0.L().M() / 72.0D)));
      } else {
         var3.a(0.0D);
         var3.b(0.0D);
         var3.c(0.0D);
         var3.d(0.0D);
      }

      var1.a(var3);
      if (var1.e() != -1) {
         if (c(var0)) {
            if (!var0.isHidden()) {
               int[] var4 = var0.c(var0.getRotationAngle());
               if (!var0.S()) {
                  var1.c((float)var0.getLeft());
                  var1.d((float)var0.getTop());
               } else {
                  float[] var5 = b(var0);
                  var1.c(var5[0]);
                  var1.d(var5[1]);
               }

               b(var0, var1);
               var1.a((float)var4[2]);
               var1.b((float)var4[3]);
               var1.f = var0.P();
               var1.i(var0.getAutoShapeType());
               label134:
               switch(var0.getMsoDrawingType()) {
               case 0:
                  GroupShape var21 = (GroupShape)var0;
                  ArrayList var6 = new ArrayList();
                  Shape[] var22 = var21.getGroupedShapes();
                  int var24 = var22.length;

                  for(int var26 = 0; var26 < var24; ++var26) {
                     Shape var28 = var22[var26];
                     if (var6.size() == 0) {
                        com.aspose.cells.b.a.a.ze.a(var6, (Object)var28);
                     } else {
                        boolean var29 = false;

                        for(int var30 = 0; var30 < var6.size(); ++var30) {
                           Shape var31 = (Shape)var6.get(var30);
                           if (var31.getZOrderPosition() > var28.getZOrderPosition()) {
                              var6.add(var30, var28);
                              var29 = true;
                              break;
                           }
                        }

                        if (!var29) {
                           com.aspose.cells.b.a.a.ze.a(var6, (Object)var28);
                        }
                     }
                  }

                  int var23 = 0;

                  while(true) {
                     if (var23 >= var6.size()) {
                        break label134;
                     }

                     Shape var25 = (Shape)var6.get(var23);
                     var25.t = var0.t;
                     zbkq var27 = new zbkq(c(var25.getMsoDrawingType()));
                     var27.c = var1;
                     var27.d = true;
                     if (var25.getMsoDrawingType() == 5) {
                        var27.e = true;
                        var27.g = ((ChartShape)var6.get(var23)).a();
                     }

                     a(var25, var27);
                     com.aspose.cells.b.a.a.ze.a(var1.b, (Object)var27);
                     ++var23;
                  }
               case 1:
                  LineShape var8 = (LineShape)var0;
                  f(var8, var1);
                  g(var0, var1);
                  i(var0, var1);
                  break;
               case 2:
                  RectangleShape var9 = (RectangleShape)var0;
                  a(var9.aa(), var1);
                  i(var0, var1);
                  break;
               case 3:
                  Oval var10 = (Oval)var0;
                  a(var10.aa(), var1);
                  break;
               case 4:
                  g(var0, var1);
                  a(var0.aa(), var1);
                  h(var0, var1);
                  i(var0, var1);
               case 5:
               case 8:
               case 10:
               case 13:
               case 15:
               case 21:
               case 22:
               case 23:
               case 24:
               case 26:
               case 27:
               case 28:
               case 29:
               default:
                  break;
               case 6:
                  TextBox var7 = (TextBox)var0;
                  a(var7.aa(), var1);
                  break;
               case 7:
                  Button var12 = (Button)var0;
                  a(var12.aa(), var1);
                  break;
               case 9:
                  g(var0, var1);
                  f((zavf)var0, var1);
                  h(var0, var1);
                  a(var0.aa(), var1);
                  i(var0, var1);
                  j(var0, var1);
                  k(var0, var1);
                  break;
               case 11:
                  CheckBox var13 = (CheckBox)var0;
                  a(var13.aa(), var1);
                  var1.e(n(var13.getCheckedValue()));
                  break;
               case 12:
                  RadioButton var14 = (RadioButton)var0;
                  a(var14.aa(), var1);
                  if (var14.isChecked()) {
                     var1.e(1);
                  } else {
                     var1.e(0);
                  }
                  break;
               case 14:
                  Label var34 = (Label)var0;
                  a(var34.aa(), var1);
                  break;
               case 16:
                  Spinner var20 = (Spinner)var0;
                  var1.f(var20.getCurrentValue());
                  var1.g(var20.getMin());
                  var1.h(var20.getMax());
                  break;
               case 17:
                  ScrollBar var37 = (ScrollBar)var0;
                  var1.f(var37.getCurrentValue());
                  var1.g(var37.getMin());
                  var1.h(var37.getMax());
                  break;
               case 18:
                  ListBox var15 = (ListBox)var0;
                  if (var15.getInputRange() != null && !"".equals(var15.getInputRange())) {
                     Range var32 = var15.Y();
                     if (var32 != null) {
                        for(int var33 = var32.a().StartRow; var33 <= var32.a().EndRow; ++var33) {
                           Cell var36 = var32.a.checkCell(var33, var32.a().StartColumn);
                           if (var36 == null) {
                              var1.w().add("");
                           } else {
                              var1.w().add(var36.j());
                           }
                        }
                     }

                     if (var15.a() != null) {
                        var1.a((List)var15.a());
                     }
                  }
                  break;
               case 19:
                  GroupBox var11 = (GroupBox)var0;
                  a(var11.aa(), var1);
                  break;
               case 20:
                  ComboBox var16 = (ComboBox)var0;
                  if (var16.getInputRange() != null && !"".equals(var16.getInputRange())) {
                     Range var17 = var16.Y();
                     if (var17 != null) {
                        for(int var35 = var17.a().StartRow; var35 <= var17.a().EndRow; ++var35) {
                           Cell var19 = var17.a.checkCell(var35, var17.a().StartColumn);
                           if (var19 == null) {
                              var1.w().add("");
                           } else {
                              var1.w().add(var19.j());
                           }
                        }
                     }

                     if (var16.getSelectedValue() != null) {
                        var1.b(var16.getSelectedValue());
                     }
                  }
                  break;
               case 25:
                  CommentShape var18 = (CommentShape)var0;
                  a(var18, var1);
                  a(var18.a().b(), var1);
                  break;
               case 30:
                  g(var0, var1);
                  f((CellsDrawing)var0, var1);
                  h(var0, var1);
                  a(var0.aa(), var1);
                  i(var0, var1);
                  j(var0, var1);
                  l(var0, var1);
                  k(var0, var1);
               }

               d(var0, var1);
               e(var0, var1);
               c(var0, var1);
               var1.j(var0.s);
               var0.s = false;
               var1.m = var0.t;
               var0.t = false;
            }
         }
      }
   }

   private static void c(Shape var0, zbkq var1) {
      var1.b(var0.N().i().e());
      var1.a(var0.N().i().d());
   }

   private static boolean c(Shape var0) {
      switch(var0.getAutoShapeType()) {
      case 0:
      case 20:
      case 32:
      case 34:
         if (var0.getWidth() == 0 && var0.getHeight() == 0) {
            return false;
         }

         if (var0.getWidth() < 0 || var0.getHeight() < 0) {
            return false;
         }
         break;
      default:
         if (var0.getWidth() <= 0 || var0.getHeight() <= 0) {
            return false;
         }
      }

      return true;
   }

   private static Color a(double var0, Color var2) {
      return Color.a((int)((1.0D - var0) * 255.0D), var2);
   }

   private static void d(Shape var0, zbkq var1) throws Exception {
      if (var0.getFillFormat().isVisible()) {
         FillFormat var2 = var0.getFill();
         zvk var3 = var1.l().c();
         var1.l().a(var3);
         switch(var2.getType()) {
         case 0:
            var1.l().a(false);
            var1.l().a(a(0.0D, Color.getWhite()));
            var1.l().a((zvk)null);
            break;
         case 1:
            var1.l().a(true);
            break;
         case 2:
            var1.l().a(false);
            var1.l().a(a(var2.getSolidFill().getTransparency(), var2.getSolidFill().getColor()));
            var1.l().a((zvk)null);
            break;
         case 3:
            var1.l().a(false);
            var3.a(0);
            a(var0, var3.a());
            break;
         case 4:
            if (var2.getTextureFill().getImageData() == null) {
               var1.l().a(true);
            } else {
               try {
                  var1.l().a(false);
                  var3.a(1);
                  a(var2, var3.b());
                  if (var2.getTextureFill().getImageData() != null) {
                     byte[] var4 = var2.getTextureFill().getImageData();
                     com.aspose.cells.b.a.d.zh var5 = new com.aspose.cells.b.a.d.zh(var4);
                     com.aspose.cells.b.a.b.zj var6 = com.aspose.cells.b.a.b.zj.a((com.aspose.cells.b.a.d.zm)var5);
                     var3.b().a(var6);
                  }
               } catch (Exception var7) {
                  var1.l().a(true);
               }
            }
            break;
         case 5:
            var1.l().a(false);
            var3.a(2);
            var3.a(a(var0.getFillFormat().getForeColor()), a(var0.getFillFormat().getBackColor()), o(var2.getPattern()));
         }

      }
   }

   private static void a(FillFormat var0, zbtb var1) {
      TextureFill var2 = var0.getTextureFill();
      if (var2 != null) {
         var1.a(var2.isTiling());
         if (var2.isTiling()) {
            var1.a(var2.getTilePicOption().getOffsetX());
            var1.b(var2.getTilePicOption().getOffsetY());
            var1.c(var2.getTilePicOption().getScaleX());
            var1.d(var2.getTilePicOption().getScaleY());
            var1.a(h(var2.getTilePicOption().getAlignmentType()));
            var1.b(g(var2.getTilePicOption().getMirrorType()));
         } else {
            var1.c(f(var2.getPicFormatOption().getType()));
            var1.e(var2.getPicFormatOption().getLeft());
            var1.f(var2.getPicFormatOption().getRight());
            var1.g(var2.getPicFormatOption().getTop());
            var1.h(var2.getPicFormatOption().getBottom());
            var1.i(var2.getPicFormatOption().getScale());
         }

      }
   }

   private static int f(int var0) {
      switch(var0) {
      case 1:
         return 1;
      case 2:
         return 2;
      default:
         return 0;
      }
   }

   private static int g(int var0) {
      switch(var0) {
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      default:
         return 0;
      }
   }

   private static int h(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 0;
      case 2:
         return 0;
      case 3:
         return 2;
      case 4:
         return 4;
      case 5:
         return 5;
      case 6:
         return 6;
      case 7:
      default:
         return 7;
      case 8:
         return 8;
      }
   }

   private static void a(Shape var0, zacp var1) {
      if (var0.getFill().getGradientFill() != null) {
         Workbook var2 = var0.L().n();
         GradientFill var3 = var0.getFill().getGradientFill();
         var1.a(var3.getAngle());
         var1.a(a(var3.getFillType()));
         var1.b(b(var3.getDirectionType()));

         for(int var4 = 0; var4 < var3.getGradientStops().getCount(); ++var4) {
            GradientStop var5 = var3.getGradientStops().get(var4);
            int var6 = var5.a.c(var2);
            int var7 = var6 & 255;
            int var8 = (var6 & '\uff00') >> 8;
            int var9 = (var6 & 16711680) >> 16;
            Color.fromArgb(var5.a() * 255 / 100, var7, var8, var9);
            var7 = var5.getCellsColor().getColor().getR() & 255;
            var8 = var5.getCellsColor().getColor().getG() & 255;
            var9 = var5.getCellsColor().getColor().getB() & 255;
            Color var11 = Color.fromArgb(var5.a() * 255 / 100, var7, var8, var9);
            var1.c().a(var11, (float)var5.getPosition());
         }

      }
   }

   static int a(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 2;
      case 2:
      default:
         return 1;
      case 3:
         return 3;
      }
   }

   static int b(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      default:
         return 5;
      }
   }

   private static void e(Shape var0, zbkq var1) {
      var1.m().a(!var0.getLineFormat().isVisible());
      if (var0.getLineFormat().isVisible()) {
         MsoLineFormat var2 = var0.getLineFormat();
         var1.m().b(i(var2.getDashStyle()));
         var1.m().a(j(var2.getStyle()));
         var1.m().a((float)((int)(var2.getWeight() * (double)var0.L().M() / 72.0D + 0.5D)));
         if (var1.m().f() < 1.0F) {
            var1.m().a(1.0F);
         }

         double var3 = var2.getWeight();
         var1.m().a(a(var2.getTransparency(), var2.getForeColor()));
      }

   }

   private static void f(Shape var0, zbkq var1) {
      var1.m().c(k(var0.getLineFormat().d()));
      var1.m().e(l(var0.getLineFormat().f()));
      var1.m().d(m(var0.getLineFormat().e()));
      var1.m().f(k(var0.getLineFormat().g()));
      var1.m().h(l(var0.getLineFormat().i()));
      var1.m().g(m(var0.getLineFormat().h()));
   }

   private static void a(zbtz var0, zbkq var1) throws Exception {
      if (var0.i() != null && !"".equals(var0.i())) {
         var1.a(var0.i());
         if (var0.l() != null) {
            var1.a(a(var0.k()));
            var1.a(Color.a(255, (Color)var0.k().getColor()));
         }

         var1.b(d(var0.g()));
         var1.c(d(var0.h()));
         var1.d(e(var0.f()));
         if (var0.q()) {
            ArrayList var2 = var0.s();
            if (var2.size() == 1) {
               FontSetting var3 = (FontSetting)var2.get(0);
               var0.i().substring(var3.getStartIndex(), var3.getStartIndex() + var3.getLength());
               var1.a(a(var3.getFont()));
            } else {
               boolean var11 = true;
               Color var4 = Color.getEmpty();
               com.aspose.cells.b.a.b.zg var5 = null;

               for(int var6 = 0; var6 < var2.size(); ++var6) {
                  FontSetting var7 = (FontSetting)var2.get(var6);
                  String var8 = var0.i().substring(var7.getStartIndex(), var7.getStartIndex() + var7.getLength());
                  com.aspose.cells.b.a.b.zg var9 = a(var7.getFont());
                  var1.a(Color.a(255, (Color)var7.getFont().getColor()));
                  if (var6 == 0) {
                     var5 = var9;
                     var4 = Color.a(255, (Color)var7.getFont().getColor());
                  } else if (var11 && (!a(var5, var9) || var4.getR() != var7.getFont().getColor().getR() || var4.getG() != var7.getFont().getColor().getG() || var4.getB() != var7.getFont().getColor().getB()) || b(var7.getFont())) {
                     var11 = false;
                  }

                  zban var10 = new zban(var8, var9, Color.a(255, (Color)var7.getFont().getColor()), 2);
                  com.aspose.cells.b.a.a.ze.a(var1.u(), (Object)var10);
               }

               if (var11 && var2.size() > 1) {
                  var1.a(var5);
                  var1.a(var4);
               }
            }
         }

      }
   }

   private static boolean a(com.aspose.cells.b.a.b.zg var0, com.aspose.cells.b.a.b.zg var1) {
      if (!com.aspose.cells.b.a.zv.b(var0.g(), var1.g())) {
         return false;
      } else if (var0.h() != var1.h()) {
         return false;
      } else if (var0.c() != var1.c()) {
         return false;
      } else if (var0.f() != var1.f()) {
         return false;
      } else if (var0.j() != var1.j()) {
         return false;
      } else {
         return var0.l() == var1.l();
      }
   }

   private static boolean b(Font var0) {
      if ((var0.isSubscript() || var0.isSuperscript()) && var0.getScriptOffset() != 0.0D) {
         return true;
      } else if (var0.getCapsType() != 0) {
         return true;
      } else {
         return var0.isNormalizeHeights();
      }
   }

   private static void a(CommentShape var0, zbkq var1) {
      var1.l(var0.getComment().getColumn());
      var1.m(var0.getComment().getRow());
      var1.j(var0.getUpperLeftColumn());
      var1.k(var0.getUpperLeftRow());
   }

   private static void g(Shape var0, zbkq var1) {
      if (!var0.N().i().d() && !var0.N().i().e()) {
         var1.a = 1;
      } else if (var0.N().i().d() && var0.N().i().e()) {
         var1.a = 3;
      } else if (var0.N().i().d() && !var0.N().i().e()) {
         var1.a = 2;
      } else {
         var1.a = 4;
      }

   }

   static com.aspose.cells.b.a.b.zg a(Font var0) throws Exception {
      int var1 = 0;
      if (var0.isBold()) {
         var1 |= 1;
      }

      if (var0.isItalic()) {
         var1 |= 2;
      }

      if (var0.isStrikeout()) {
         var1 |= 8;
      }

      if (var0.getUnderline() != 0) {
         var1 |= 4;
      }

      double var2 = var0.getDoubleSize();

      try {
         return new com.aspose.cells.b.a.b.zg(var0.getName(), (float)var2, var1);
      } catch (Exception var6) {
         com.aspose.cells.a.d.zfq var5 = com.aspose.cells.a.d.zfs.b(var0.getName(), var1, false);
         return new com.aspose.cells.b.a.b.zg(var0.getName(), (float)var2, var5.g());
      }
   }

   private static Color a(Color var0) {
      return var0.getA() == 0 ? Color.a(255, (Color)var0) : var0;
   }

   static int c(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
      case 30:
         return 30;
      case 5:
         return 5;
      case 6:
         return 6;
      case 7:
         return 7;
      case 8:
         return 8;
      case 9:
         return 9;
      case 10:
      case 13:
      case 15:
      case 21:
      case 22:
      case 23:
      case 26:
      case 27:
      case 28:
      default:
         return -1;
      case 11:
         return 11;
      case 12:
         return 12;
      case 14:
         return 14;
      case 16:
         return 16;
      case 17:
         return 17;
      case 18:
         return 18;
      case 19:
         return 19;
      case 20:
         return 20;
      case 24:
         return 24;
      case 25:
         return 25;
      case 29:
         return 29;
      }
   }

   private static int i(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 4;
      case 3:
         return 2;
      case 4:
         return 3;
      case 5:
         return 5;
      case 6:
         return 6;
      case 7:
         return 7;
      default:
         return 6;
      }
   }

   private static int j(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      default:
         return 0;
      }
   }

   private static int k(int var0) {
      switch(var0) {
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      case 5:
         return 5;
      default:
         return 0;
      }
   }

   private static int l(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      default:
         return 0;
      }
   }

   private static int m(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      default:
         return 0;
      }
   }

   private static int n(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      default:
         return 0;
      }
   }

   private static int o(int var0) {
      switch(var0) {
      case 2:
         return 6;
      case 3:
         return 7;
      case 4:
         return 8;
      case 5:
         return 10;
      case 6:
         return 11;
      case 7:
         return 12;
      case 8:
         return 13;
      case 9:
         return 14;
      case 10:
         return 15;
      case 11:
         return 16;
      case 12:
         return 17;
      case 13:
         return 9;
      case 14:
         return 18;
      case 15:
         return 19;
      case 16:
         return 20;
      case 17:
         return 21;
      case 18:
         return 22;
      case 19:
         return 23;
      case 20:
         return 24;
      case 21:
         return 25;
      case 22:
         return 26;
      case 23:
         return 27;
      case 24:
         return 28;
      case 25:
         return 29;
      case 26:
         return 30;
      case 27:
         return 31;
      case 28:
         return 33;
      case 29:
         return 32;
      case 30:
         return 34;
      case 31:
         return 35;
      case 32:
         return 36;
      case 33:
         return 37;
      case 34:
         return 38;
      case 35:
         return 39;
      case 36:
         return 40;
      case 37:
         return 41;
      case 38:
         return 42;
      case 39:
         return 43;
      case 40:
         return 44;
      case 41:
         return 45;
      case 42:
         return 46;
      case 43:
         return 47;
      case 44:
         return 48;
      case 45:
         return 4;
      case 46:
         return 49;
      case 47:
         return 50;
      case 48:
         return 51;
      case 49:
         return 52;
      default:
         return 4;
      }
   }

   static int d(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      case 5:
         return 5;
      case 6:
         return 6;
      case 7:
         return 7;
      case 8:
         return 8;
      case 9:
         return 9;
      default:
         return 1;
      }
   }

   static int e(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      default:
         return 2;
      }
   }

   private static void h(Shape var0, zbkq var1) {
      var1.l = new zach();
      zacg var2 = var0.ai();

      for(int var3 = 327; var3 < 337; ++var3) {
         if (var2.c(var3)) {
            int var4 = var2.b(var3);
            zak var5 = new zak();
            var5.b(var3);
            var5.a(var4);
            com.aspose.cells.b.a.a.ze.a(var1.l.a, (Object)var5);
         }
      }

   }

   private static void i(Shape var0, zbkq var1) {
      if (var0.getRotationAngle() >= 0.0D) {
         var1.a((int)(var0.getRotationAngle() + 0.5D));
      } else {
         var1.a((int)(var0.getRotationAngle() - 0.5D));
      }

   }

   private static void j(Shape var0, zbkq var1) {
      TextEffectFormat var2 = var0.getTextEffect();
      zbsn var3 = new zbsn();
      var3.a(var2.getText());
      var3.b(var2.getFontName());
      var3.a(var2.getFontSize());
      var3.b(var2.getFontItalic());
      var3.a(var2.getFontBold());
      var3.c(var2.getRotatedChars());
      var3.b(p(var2.d()));
      var3.c(q(var2.getPresetShape()));
      var1.a(var3);
   }

   private static int p(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      case 5:
         return 5;
      case 6:
         return 6;
      default:
         return 1;
      }
   }

   private static int q(int var0) {
      switch(var0) {
      case 136:
         return 136;
      case 137:
         return 137;
      case 138:
         return 138;
      case 139:
         return 139;
      case 140:
         return 140;
      case 141:
         return 141;
      case 142:
         return 142;
      case 143:
         return 143;
      case 144:
         return 144;
      case 145:
         return 145;
      case 146:
         return 146;
      case 147:
         return 147;
      case 148:
         return 148;
      case 149:
         return 149;
      case 150:
         return 150;
      case 151:
         return 151;
      case 152:
         return 152;
      case 153:
         return 153;
      case 154:
         return 154;
      case 155:
         return 155;
      case 156:
         return 156;
      case 157:
         return 157;
      case 158:
         return 158;
      case 159:
         return 159;
      case 160:
         return 160;
      case 161:
         return 161;
      case 162:
         return 162;
      case 163:
         return 163;
      case 164:
         return 164;
      case 165:
         return 165;
      case 166:
         return 166;
      case 167:
         return 167;
      case 168:
         return 168;
      case 169:
         return 169;
      case 170:
         return 170;
      case 171:
         return 171;
      case 172:
         return 172;
      case 173:
         return 173;
      case 174:
         return 174;
      case 175:
         return 175;
      case 176:
      case 177:
      case 178:
      case 179:
      case 180:
      case 181:
      case 182:
      case 183:
      case 184:
      case 185:
      case 186:
      case 187:
      case 188:
      case 189:
      case 190:
      case 191:
      case 192:
      case 193:
      case 194:
      case 195:
      case 196:
      case 197:
      case 198:
      case 199:
      case 200:
      case 201:
      case 202:
      case 203:
      case 204:
      case 205:
      case 206:
      case 207:
      case 208:
      case 209:
      case 210:
      case 211:
      case 212:
      case 213:
      case 214:
      case 215:
      case 216:
      case 217:
      case 218:
      case 219:
      case 220:
      case 221:
      case 222:
      case 223:
      case 224:
      case 225:
      case 226:
      case 227:
      case 228:
      case 229:
      case 230:
      case 231:
      case 232:
      case 233:
      case 234:
      case 235:
      case 236:
      case 237:
      case 238:
      case 239:
      case 240:
      case 241:
      case 242:
      case 243:
      case 244:
      case 245:
      case 246:
      case 247:
      case 248:
      case 249:
      case 250:
      case 251:
      case 252:
      case 253:
      case 254:
      default:
         return 145;
      case 255:
         return 255;
      }
   }

   private static ArrayList a(Shape var0, ShapePathPointCollection var1) {
      ArrayList var2 = new ArrayList();

      for(int var3 = 0; var3 < var1.getCount(); ++var3) {
         ShapePathPoint var4 = var1.get(var3);
         com.aspose.cells.b.a.b.zn var5 = new com.aspose.cells.b.a.b.zn(var4.getX(), var4.getY());
         com.aspose.cells.b.a.a.ze.a(var2, (Object)var5);
      }

      return var2;
   }

   private static void k(Shape var0, zbkq var1) {
      if (var0.ah()) {
         ShapePathCollection var2 = ((CustomGeometry)var0.getGeometry()).getPaths();
         zacc var3 = new zacc();
         ShapeSegmentPathCollection var4 = null;
         ArrayList var5 = new ArrayList();
         if (var2.getCount() != 0) {
            Iterator var6 = var2.iterator();

            while(var6.hasNext()) {
               ShapePath var7 = (ShapePath)var6.next();
               ArrayList var8 = new ArrayList();
               if (var8.size() > 0) {
                  var8.clear();
               }

               zaca var9 = new zaca();
               var9.a(var7.c);
               var9.b(var7.b != 4);
               zanv var10 = null;
               var4 = var7.getPathSegementList();
               Iterator var11 = var4.iterator();

               while(var11.hasNext()) {
                  ShapeSegmentPath var12 = (ShapeSegmentPath)var11.next();
                  var10 = new zanv();
                  var10.a(r(var12.getType()));
                  var10.a(a(var0, var12.getPoints()));
                  com.aspose.cells.b.a.a.ze.a(var8, (Object)var10);
               }

               var9.a(var8);
               var9.b(var7.e);
               var9.a(var7.d);
               com.aspose.cells.b.a.a.ze.a(var5, (Object)var9);
            }

            var3.a(var5);
            var1.a(var3);
         }
      }
   }

   private static void l(Shape var0, zbkq var1) {
      zanx var2 = var0.V();
      zbcy var3 = new zbcy();
      var3.a(s(var2.b()));
      var3.b(var2.d());
      var3.a(var2.c());
      var3.a(var2.s());
      var3.b(var2.t());
      var3.b(var2.f());
      var3.c(var2.g());
      var3.m(var2.q());
      var3.n(var2.r());
      var3.a(var2.e());
      var3.j(var2.n());
      var3.k(var2.o());
      var3.f(var2.j());
      var3.h(var2.l());
      var3.g(var2.k());
      var3.i(var2.m());
      var3.d(var2.h());
      var3.e(var2.i());
      var3.l(var2.p());
      var1.a(var3);
   }

   private static int r(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      default:
         return 5;
      }
   }

   private static int s(int var0) {
      switch(var0) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      case 5:
         return 5;
      default:
         return 1;
      }
   }
}
